from django.db import models


# Create your models here.
class SimilarCharacter(models.Model):
    TYPE_CHOICES = [
        (1, "text"),
        (2, "image")
    ]
    word = models.CharField(max_length=10, verbose_name="异体字/字头", blank=True, null=True)
    type = models.IntegerField(verbose_name="文件类型", choices=TYPE_CHOICES)
    image_url = models.TextField(verbose_name="异体字图片链接", blank=True, null=True)
    pinyin = models.TextField(verbose_name="拼音", blank=True)
    image_path_label = models.TextField(verbose_name="出处图片路径", blank=True, null=True)
    reference = models.TextField(verbose_name="自定义出处", blank=True, null=True)
    parent_id = models.ForeignKey("self", verbose_name="上一级", blank=True, null=True, on_delete=models.SET_NULL)

    class Meta:
        db_table = "similarcharacter"
        verbose_name = '异体字表'
        verbose_name_plural = verbose_name
        app_label = "variant_character"
